<!DOCTYPE html>
<html>
<head>
	<title>人员列表</title>
	<include file='public/head'>
	<style>
		.layui-legend-size{font-size:14px !important;}
		.layui-nopadding{padding:0 !important;}
		.layui-overflow{overflow:auto;}
		.layui-nomargin{margin: 0 !important;}
		.layui-bottom{border-bottom:1px solid rgb(226, 226, 226);}
		.layui-input{height:30px !important; }
		.layui-form-search-item .layui-inline{margin-bottom: 5px;} 
		.layui-form-search-item label{margin-left: 15px;}
		.layui-table-page {padding: 7px 0px 0px;}
		.layui-field-padding{border-width: 1px;padding:0 0 5px 10px;}

		.choose{
			background: #b0d8ff;
		}

		.unchoose{}

	</style>
</head>
<body>
<form class="layui-form">
	<table class="layui-table" id="db-list1">
		<tbody>
<!-- 			<tr>
				<select name="modules" lay-filter="list" lay-verify="required" lay-search="">
		          <option value="">直接选择或搜索选择</option>
		          <volist name="list" id="vo">
		          	<option value="{$vo.id}">{$vo.user_login}</option>
		          </volist>
		        </select>
			</tr> -->
			<volist name="list" id="vo">
				<tr <php>if($vo['checked']==true){ echo "class='choose'";}</php>>
					<td>
						{$vo.user_login}
					</td>
					<td hidden="true">
						<input type="checkbox" name="vname[]" value="{$vo.user_login}" <php>if($vo['checked']==true){ echo "checked='checked'";}</php>>
						<input type="checkbox" name="vid[]" value="{$vo.id}" <php>if($vo['checked']==true){ echo "checked='checked'";}</php>>
					</td>
				</tr>
			</volist>
		</tbody>
	</table>
</form>
</body>

<include file='public/scripts'>

<script type="text/javascript">

// jQuery(function() {
	//当列被点击时触发
    jQuery("#db-list1 tr").click(
        function() {
        	var vname = $(this).find("input[name='vname[]']");
            vname.prop('checked', !vname.prop('checked'));
			var vid = $(this).find("input[name='vid[]']");
            vid.prop('checked', !vid.prop('checked'));
            jQuery(this).toggleClass("choose");
            
        });
// });

function callbackdata(){
	var vname = [];
    $("input[name='vname[]']:checked").each(function(){
    	vname.push($(this).val());
    });
    
    var vid = [];
    $("input[name='vid[]']:checked").each(function(){
    	vid.push($(this).val());
    });
    var arr = {};
    arr['vname'] = vname;
    arr['vid'] = vid;
    return arr;
}

</script>

</html>